def shrink_goal(goal_x, goal_y, start_x, start_y, goal_yaw, shrink_ratio=0.25):
    """
    沿着goal_yaw的反方向缩短目标区域
    
    Args:
        goal_x: 目标区域的x坐标列表，长度为4，表示矩形四个角点的x坐标
        goal_y: 目标区域的y坐标列表，长度为4，表示矩形四个角点的y坐标
        start_x: 起点x坐标
        start_y: 起点y坐标
        goal_yaw: 目标朝向角度，弧度制
        shrink_ratio: 缩短比例，默认为0.25，表示缩短为原来的1/4
        
    Returns:
        new_goal_x: 缩短后的目标区域x坐标列表
        new_goal_y: 缩短后的目标区域y坐标列表
    """
    import numpy as np
    
    # 矩形的四个点坐标
    points = np.array(list(zip(goal_x, goal_y)))
    
    # 计算矩形的中心点
    center_x = np.mean(goal_x)
    center_y = np.mean(goal_y)
    
    # 计算四个边的长度，找出最短的两条边
    edges = []
    for i in range(4):
        next_i = (i + 1) % 4
        edge_length = np.sqrt((points[next_i][0] - points[i][0])**2 + (points[next_i][1] - points[i][1])**2)
        edges.append((i, next_i, edge_length))
    
    # 按照边长排序
    edges.sort(key=lambda x: x[2])
    
    # 找出两条短边
    short_edges = edges[:2]
    
    # 计算两条短边的中点
    midpoints = []
    for i, next_i, _ in short_edges:
        mid_x = (points[i][0] + points[next_i][0]) / 2
        mid_y = (points[i][1] + points[next_i][1]) / 2
        midpoints.append((mid_x, mid_y))
    
    # 计算goal_yaw方向的向量
    yaw_vector = np.array([np.cos(goal_yaw), np.sin(goal_yaw)])
    
    # 计算从中心点到两个短边中点的向量
    vectors = []
    for mid_x, mid_y in midpoints:
        vector = np.array([mid_x - center_x, mid_y - center_y])
        vector = vector / np.linalg.norm(vector)  # 归一化
        vectors.append(vector)
    
    # 计算这两个向量与goal_yaw向量的点积，找出更靠近goal_yaw方向的短边
    dots = [np.dot(v, yaw_vector) for v in vectors]
    
    # 找出需要移动的短边（沿goal_yaw反方向的短边）和固定的短边（另一条短边）
    move_edge_idx = 0 if dots[0] > dots[1] else 1
    fixed_edge_idx = 1 - move_edge_idx
    
    move_edge = short_edges[move_edge_idx]
    fixed_edge = short_edges[fixed_edge_idx]
    
    # 需要移动的两个点的索引
    move_points_idx = [move_edge[0], move_edge[1]]
    
    # 固定的两个点的索引
    fixed_points_idx = [fixed_edge[0], fixed_edge[1]]
    
    # 计算矩形的长轴方向（从固定短边到移动短边的方向）
    fixed_midpoint = midpoints[fixed_edge_idx]
    move_midpoint = midpoints[move_edge_idx]
    
    long_axis = np.array([move_midpoint[0] - fixed_midpoint[0], 
                          move_midpoint[1] - fixed_midpoint[1]])
    long_axis_length = np.linalg.norm(long_axis)
    long_axis = long_axis / long_axis_length  # 归一化
    
    # 计算goal_yaw的反方向
    reverse_yaw_vector = -yaw_vector
    
    # 确保long_axis与reverse_yaw_vector方向相似
    if np.dot(long_axis, reverse_yaw_vector) < 0:
        long_axis = -long_axis
    
    # 计算移动距离（长轴长度 * (1-shrink_ratio)）
    move_distance = long_axis_length * (1 - shrink_ratio)
    
    # 创建新的goal_x和goal_y列表，初始化为原来的值
    new_goal_x = goal_x.copy()
    new_goal_y = goal_y.copy()
    
    # 移动需要移动的两个点
    for idx in move_points_idx:
        # 沿着goal_yaw的反方向移动
        new_goal_x[idx] = goal_x[idx] + reverse_yaw_vector[0] * move_distance
        new_goal_y[idx] = goal_y[idx] + reverse_yaw_vector[1] * move_distance
    
    return new_goal_x, new_goal_y
